<template>
    <div>
        <Header :goback="goback" :title="header_title" :right_text1="'保存'"></Header>
        <div class="topheader page">
            <div class="tip"></div>
            <van-cell-group inset class="textarea infofield">
                <van-field v-model="name" rows="1" autosize type="textarea" maxlength="20" placeholder="请输入"
                    show-word-limit />
            </van-cell-group>
        </div>
    </div>
</template>

<script>
import Header from '@/components/header.vue'
import { Toast } from 'vant';
export default {
    components: {
        Header
    },
    data() {
        return {
            header_title: '',
            name: '',
            workInfo:this.$store.state.workInfo
        }
    },
    mounted() {
        let params = this.$route.params;
        this.header_title = params.page;
        this.name = this.workInfo.companyName;
    },
    methods: {
        rightMethod() {
            if (!this.name) {
                Toast('请输入' + this.header_title);
                return;
            }
            this.workInfo.companyName = this.name;
            this.$store.commit('setworkInfo', this.workInfo);
            this.$router.replace('/experience');
        },
        goback() {
            this.$router.replace('/experience');
        }
    }
}
</script>

<style scoped>
.tip {
    height: 0.32rem;
}

.textarea .van-cell {
    padding: unset;
}

.van-cell-group--inset.textarea {
    margin: unset;
}
</style>